package com.example.blog.service.impl;

import com.example.blog.entity.DictionaryGroup;
import com.example.blog.entity.dto.dictionaryGroup.AddOrUpdateDictGroupDTO;
import com.example.blog.mapper.DictionaryGroupMapper;
import com.example.blog.service.DictionaryGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.blog.util.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 字典组表 服务实现类
 * </p>
 *
 * @author wlh
 * @since 2024-01-10
 */
@Service
public class DictionaryGroupServiceImpl extends ServiceImpl<DictionaryGroupMapper, DictionaryGroup> implements DictionaryGroupService {

    @Override
    public void addOrUpdate(AddOrUpdateDictGroupDTO addOrUpdateDictGroupDTO) {
        DictionaryGroup dictionaryGroup = BeanUtils.copyProperties(addOrUpdateDictGroupDTO, DictionaryGroup.class);

        saveOrUpdate(dictionaryGroup);
    }
}
